package com.elcl.adapter;

import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * tabLayout+FragmentPagerAdapter的实现，简单实现（只有汉字）
 * 
 */
public class BaseSimpleFragmentPagerAdapter extends FragmentPagerAdapter {
	
	private List<Fragment> list_fragment;
	private List<String> list_title;
	
	
	public BaseSimpleFragmentPagerAdapter(FragmentManager fm,
			List<Fragment> list_fragment, List<String> list_title) {
		super(fm);
		this.list_fragment = list_fragment;
		this.list_title = list_title;
	}

	@Override
	public Fragment getItem(int arg0) {
		return list_fragment.get(arg0);
	}

	@Override
	public int getCount() {
		return list_title.size();
	}

	//此方法用来显示tab上的名字 
	@Override
	public CharSequence getPageTitle(int position) {
		return list_title.get(position % list_title.size());
	}
}
